<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'My Web Application',
    'language'=>'ru',

// preloading 'log' component
    'preload' => array('log'),

    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
        'application.extensions.*',
        'application.modules.user.models.*',
        'application.modules.registration.models.*',
        'application.modules.blog.models.*',
    ),
    'defaultController'=>'blog/post',
    'modules' => array(
        // uncomment the following to enable the Gii tool

        /*'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'password',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
    //			'ipFilters'=>array('127.0.0.1','::1'),
        ),*/
        'blog' => array(),
        'user' => array(
            'debug' => false,
            'usersTable' => 'user',
            'translationTable' => 'translation',
            'textSettingsTable' => 'yumtextsettings',
            'loginType' => 2,
            //http://www.yiiframework.com/forum/index.php?/topic/7591-module-yii-user-management-module/page__st__160
            'mailer'=>'PHPMailer',
                        'phpmailer'=>array(
                                'transport'=>'smtp',
                                'html'=>true,
                                'properties'=>array(
                                        'CharSet' => 'UTF-8',
                                        'Host' => 'smtp.yandex.ru', // SMTP server
                                        'SMTPDebug' => false,          // enables SMTP debug information (for testing)
                                        'SMTPAuth' => true,            // enable SMTP authentication
                                        'SMTPSecure' => 'ssl',         // sets the prefix to the servier
                                        'Port' => 465,                   // set the SMTP port for the GMAIL server
                                        'Username' => 'none.nonename@yandex.ru',  // GMAIL username
                                        'Password' => '5tgbvfr4',        // GMAIL password
                                ),
                                'msgOptions'=>array(
                                        'fromName'=>'Registration System',
                                        'toName'=>'You doomed user',
                                ),
                        ),
        ),
        'usergroup' => array(
            'usergroupTable' => 'user_group',
            'usergroupMessagesTable' => 'user_group_message',
        ),
        'membership' => array(
            'membershipTable' => 'membership',
            'paymentTable' => 'payment',
        ),
        'friendship' => array(
            'friendshipTable' => 'friendship',
        ),
        'profile' => array(
            'privacySettingTable' => 'privacy_setting',
            'profileFieldsGroupTable' => 'profile_field_group',
            'profileFieldsTable' => 'profile_field',
            'profileTable' => 'profile',
            'profileCommentTable' => 'profile_comment',
            'profileVisitTable' => 'profile_visit',
        ),
        'role' => array(
            'rolesTable' => 'role',
            'userHasRoleTable' => 'user_role',
            'actionTable' => 'action',
            'permissionTable' => 'permission',
        ),
        'messages' => array(
            'messagesTable' => 'message',
        ),
        'registration' => array(
            'registrationEmail' => 'none.nonename@yandex.ru',
            'registrationPhone' => '+38(050)111-11-11',
            'enableCaptcha' => true,
            /*'controllerMap'=>array(
          'registration'=>array(
              'class'=>'application.controllers.RegistrationController'),
          ),
          'registrationView' => 'application.views.registration.registration',*/
        ),

    ),

    // application components
    'components' => array(
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
            'class' => 'application.modules.user.components.YumWebUser',
            'loginUrl' => array('//user/user/login'),
        ),
        // uncomment the following to enable URLs in path-format
        /*
        'urlManager'=>array(
            'urlFormat'=>'path',
            'rules'=>array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),
        ),
        */

        // uncomment the following to use a MySQL database

        'db' => array(
            'enableProfiling' => true,
            'connectionString' => 'mysql:host=localhost;dbname=batyuta_dudin',
            'emulatePrepare' => true,
            'username' => 'batyuta_dudin',
            'password' => '_batyuta_dudin_',
            'charset' => 'utf8',
        ),

        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'log'=>array(
            'class'=>'CLogRouter',
            'enabled'=>YII_DEBUG,
            'routes'=>array(
                array(
                    'class'=>'CWebLogRoute',
                    //
                    // I include *trace* for the
                    // sake of the example, you can include
                    // more levels separated by commas
                    'levels'=>'info',
                    //
                    // I include *vardump* but you
                    // can include more separated by commas
                    'categories'=>'vardump',
                    //
                    // This is self-explanatory right?
                    'showInFireBug'=>true
                ),
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'info, error, warning',
                ),/*
                array(
                    'class'=>'application.extensions.yii-debug-toolbar.YiiDebugToolbarRoute',
                    'levels'=>'info, error, warning',
                    'ipFilters'=>array('127.0.0.1'),
                ),*/
            ),
        ),

    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => array(
        // this is used in contact page
        'adminEmail' => 'none.nonename@yandex.ru',
    ),
);
